#完成四大基础数据结构的CRUD操作
#1 list
>>> l = []
>>> id(l)
2035138209416
>>> l.append("a")
>>> l
['a']
>>> id(l)
2035138209416
>>> l = l + ["b"]
>>> l
['a', 'b']
>>> l += ["c"]
>>> l
['a', 'b', 'c']
>>> l
['a', 'b', 'c']
>>> l = ["a"]*10
>>> l
['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']
>>> id(l[2])
2035137117800
>>> id(l)
2035138209288
>>> l[2]
'a'
>>> l
['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']
>>> l.insert(1, 'd')
>>> l
['a', 'd', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']
>>> l [2:8:3]
['a', 'a']
>>> l = [1,2,3,4,5,6,7,8,9,]
>>> l [2:8:3]
[3, 6]
>>> l[-1]
9
>>> l
[1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> l.index('a')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: 'a' is not in list
>>> l.index("a")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: 'a' is not in list
>>> l.index(4)
3
>>>>>> l
[1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> l2
[6, 5, 4, 3, 2, 1]
>>> l[-1]
9
>>> l.index(9)
8
>>> l[0]='leo'
>>> l
['leo', 2, 3, 4, 5, 6, 7, 8, 9]
>>> l[0:2]='sky'
>>> l
['s', 'k', 'y', 3, 4, 5, 6, 7, 8, 9]
>>> x = l.pop90
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'pop90'
>>> x = l.pop()
>>> l
['s', 'k', 'y', 3, 4, 5, 6, 7, 8]
>>> x
9
>>> clear()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'clear' is not defined
>>> clear(l)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'clear' is not defined
>>> l
['s', 'k', 'y', 3, 4, 5, 6, 7, 8]
>>> l.sort()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'int' and 'str'
#2 Tuple
>>> d
{'a': 1}
>>> d2 = {"b":2, "c": 3}
>>> d.update(d2)
>>> d
{'a': 1, 'b': 2, 'c': 3}
>>> d
{'a': 1, 'b': 2, 'c': 3}
>>> d.setdefault('b', 0)
2
>>> d.setdefault('d', 0)
0
>>> d
{'a': 1, 'b': 2, 'c': 3, 'd': 0}
>>> d
{'a': 1, 'b': 2, 'c': 3}
>>> d3 ={"d":4, "e":5}
>>> d.update(d3)
>>> d
{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}
>>> d.setdefault('d',0)
4
>>> d['d']
4
>>> d.get('e')
5
>>> d.get('e',0)
5
>>> d.keys()
dict_keys(['a', 'b', 'c', 'd', 'e'])
>>> d.values()
dict_values([1, 2, 3, 4, 5])
>>> d.items()
dict_items([('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5)])
>>> d['a'=99]
  File "<stdin>", line 1
    d['a'=99]
         ^
SyntaxError: invalid syntax
>>> d['a']=99
>>> d
{'a': 99, 'b': 2, 'c': 3, 'd': 4, 'e': 5}
>>> d.pop('a')
99
>>> d
{'b': 2, 'c': 3, 'd': 4, 'e': 5}
>>> popitem()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'popitem' is not defined
>>> d.popitem()
('e', 5)
>>> d.popitem()
('d', 4)
>>> d.popitem()
('c', 3)
>>> d.popitem()
('b', 2)
>>> popitem()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'popitem' is not defined
>>> clear()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'clear' is not defined
>>> d
{}

#3 Set
>>> s = {'a', 'b', 'c'}
>>> s
{'b', 'a', 'c'}
>>> s.remove('a')
>>> s
{'b', 'c'}
>>> s.discard('e')
>>> s
{'b', 'c'}
>>> s.discard('b')
>>> s
{'c'}
>>> s.remove('c')
>>> s
set()
>>>



